package br.uniriotec.pssgbd.trab.view.controle;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.uniriotec.pssgbd.trab.model.bo.DegustacaoBO;
import br.uniriotec.pssgbd.trab.model.entidade.Degustacao;

public class DegustacaoServlet extends BaseServlet{	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected void listar(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		try {
			List<Degustacao> listaDegustacoes = DegustacaoBO.getInstance().listar();
			request.setAttribute("listaDegustacoes", listaDegustacoes);

			RequestDispatcher rd = request
					.getRequestDispatcher("/pages/rotulo/listarDegustacoes.jsp");
			rd.forward(request, response);

		} catch (Exception e) {
			response.sendRedirect("erroGeral.jsp?tituloPagina=Listar Degustacoes&mensagem=Erro na listagem de degustacoes! Detalhe: " + e.getMessage());
		}
	}

	@Override
	protected void alterar(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void consultar(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void excluir(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void incluir(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
	}

}
